package com.longcai.controller.clyjuser;


import com.longcai.bean.ApiResult;
import com.longcai.entity.customer.ClyjAddress;
import com.longcai.service.clyjuser.ClyjAddressService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户地址表 前端控制器
 * </p>
 *
 * @author M
 * @since 2019-04-24
 */
@RestController
@RequestMapping("/clyjAddress")
public class ClyjAddressController {

    @Autowired
    private ClyjAddressService clyjAddressService;

    /**
     * 根据用户id查询对应收货地址
     *
     * @param id
     * @return
     */
    @ApiOperation(value = "根据id获取用户收货地址")
    @GetMapping("/{id}")
    public ApiResult getAds(@PathVariable String id) {

        return this.clyjAddressService.getAds(id);
    }

    /**
     * 新增收货地址
     *
     * @param clyjAddress
     * @return
     */
    @PostMapping(value = "/saveAds")
    public ApiResult saveAds(ClyjAddress clyjAddress) {

        return this.clyjAddressService.saveAds(clyjAddress);

    }
}

